import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { CommonData } from './types';

/**
 * 上传图片接口
 * @param formData
 * @returns
 */
export const uploadImageApi = (formData: FormData): AxiosPromise<any> => {
    return request({
        url: '/resource/oss/upload',
        method: 'post',
        data: formData,
        headers: {
            'Content-Type': 'multipart/form-data'
        }
    });
};

/**
 * 获取所有下拉框数据  
 * @returns 
 */
export const getCommonData = (): AxiosPromise<CommonData> => {
    return request({
        url: '/api/common/get/all_select',
        method: 'get'
    });
};
